package com.ruoyi.web.controller.system;

import com.ruoyi.system.service.IAiService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LiuYu
 * @version: V1.0
 * @className: AIController
 * @description: 类的功能描述
 * @time 2025/6/14
 */
@Tag(name = "AI接口",  description = "AI功能相关的接口")
@RestController
@RequestMapping("/ai")
public class AiController {

    @Autowired
    private IAiService aiService;

    @GetMapping("/ask")
    @Operation(summary = "提问接口", description = "向 AI 提问并返回回答")
    public String askQuestion(@Parameter(description = "用户提出的问题") @RequestParam String question) {
        return aiService.chatMessage(question);
    }

}
